package bjfuwjx.exp4;

import java.awt.geom.Ellipse2D;

public class Ball {
    public Double x;
    public Double y;
    public Double speed;
    public Double radius;
    public Ball(Double[] position){
        this.x=position[0];
        this.y=position[1];
        this.speed=RedFlag.speed;
        this.radius=40.0;
    }
    public void move_right() {
        if(x<=1000) {
            x+=speed;
        }
    }
    public void move_left() {
        if(x>=-40) {
            x-=speed;
        }
    }
    public Ellipse2D shape(){
        return new Ellipse2D.Double(x,y,radius,radius);
    }
}